package GUI;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class incorrectRegWindow extends JFrame {
    public  incorrectRegWindow(){
        JPanel panel3 = new JPanel(new GridLayout(4, 1,20,20));
        JLabel identityLab=new JLabel("请选择身份！");
        JLabel lab2=new JLabel(" ");
        JButton but = new JButton("返回");
        this.setSize(200,230);
        panel3.setSize(this.getSize());
        panel3.add(lab2);
        panel3.add(identityLab);
        panel3.add(but);
        but.setBackground(Color.lightGray);
        but.addActionListener(new backListener());
        this.getContentPane().add(BorderLayout.CENTER,panel3);
        this.setLayout(new FlowLayout());//流式布局
        this.setLocationRelativeTo(null);//居中
        this.setTitle("在线考试平台");
        this.setVisible(true);
        //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    public class backListener implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {//关闭注册界面
            incorrectRegWindow.this.dispose();
            new enterWindow();
        }
    }
}
